package com.cc.service.impl;

import com.cc.mapper.LogMapper;
import com.cc.pojo.EmpQueryParam;
import com.cc.pojo.OperateLog;
import com.cc.pojo.PageResult;
import com.cc.service.LogService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class LogServiceImpl implements LogService {
    @Autowired
    private LogMapper logMapper;
    @Override
    public PageResult<OperateLog> list(EmpQueryParam empQueryParam) {
        PageHelper.startPage(empQueryParam.getPage(),empQueryParam.getPageSize());
        List <OperateLog> operateLogList=logMapper.list(empQueryParam);
        Page<OperateLog> operateLogPage=(Page<OperateLog>) operateLogList;
        return new PageResult(operateLogPage.getTotal(),operateLogPage.getResult());



    }
}
